package com.yycx.module.bus.client.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.yycx.common.mybatis.annotation.TableAlias;
import com.yycx.common.mybatis.base.entity.AbstractEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.experimental.Delegate;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 订单明细
 *
 * @author flyme
 * @date 2020-08-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("bus_order_details")
@TableAlias("bod")
@ApiModel(value = "BusOrderDetails对象", description = "订单明细")
public class  BusOrderDetails extends AbstractEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "orderDetailsId", type = IdType.ASSIGN_ID)
    private Long orderDetailsId;

    @ApiModelProperty(value = "父ID")
    private Long parentId;

    @ApiModelProperty(value = "订单ID")
    private Long orderId;

    @ApiModelProperty(value = "账套id")
    private Long companyId;

    @ApiModelProperty(value = "机构ID")
    private Long organizationId;

    @ApiModelProperty(value = "部门")
    private Long deptId;

    @ApiModelProperty(value = "业务员")
    private Long saleManId;

    @ApiModelProperty(value = "客户")
    private Long customId;
    @ApiModelProperty(value = "保证金ID")
    private Long bzjId;

    @ApiModelProperty(value = "供应商")
    private Long supplierId;

    @ApiModelProperty(value = "产品ID")
    private Long drugsId;

    @ApiModelProperty(value = "产品批次ID")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long drugsLotId;

    @ApiModelProperty(value = "销售数量")
    private BigDecimal saleNum;

    @ApiModelProperty(value = "明细类型 1:销售 2:退货 3:补货,4:票折")
    private String saleType;

    @ApiModelProperty(value = "销售日期")
    private Date saleDate;

    @ApiModelProperty(value = "销售价")
    private BigDecimal salePrice;




    @ApiModelProperty(value = "结算价")
    private BigDecimal settlePrice;

    @ApiModelProperty(value = "成本价")
    private BigDecimal costPrice;



    @ApiModelProperty(value = "销售金额")
    private BigDecimal saleAmount;

    @ApiModelProperty(value = "成本金额")
    private BigDecimal costAmount;



    @ApiModelProperty(value = "结算发货金额")
    private BigDecimal settleSendAmount;

    @ApiModelProperty(value = "应结算金额")
    private BigDecimal settleAmount;

    @ApiModelProperty(value = "应结算金额")
    private BigDecimal settleAmount2;

    @ApiModelProperty(value = "应结算金额")
    private BigDecimal settleAmount3;

    @ApiModelProperty(value = "购货方底价")
    private BigDecimal customFloorAmount;

    @ApiModelProperty(value = "供货方高开金额")
    @Deprecated
    private BigDecimal supplierGapUpAmount;

    @ApiModelProperty(value = "供货方应返金额")
    private BigDecimal supplierRetable;

    @ApiModelProperty(value = "供货方应返金额(朗迪)")
    private BigDecimal supplierRetable2;

    @ApiModelProperty(value = "发票金额")
    private BigDecimal invoiceAmount;

    @ApiModelProperty(value = "发票日期")
    private  String invoiceDate;

    @ApiModelProperty(value = "发票号码")
    private  String invoiceNo;

    @ApiModelProperty(value = "开票金额")
    private BigDecimal invoicePaymentAmount;



    @ApiModelProperty(value = "开票税金")
    private  BigDecimal invoiceSj;

    @ApiModelProperty(value = "开票日期")
    private  String invoiceAmountDate;

    @ApiModelProperty(value = "开票单号")
    private  String invoicePaymentNo;

    @ApiModelProperty(value = "开票单位")
    private  String invoiceunitName;

    @ApiModelProperty(value = "供货方高开税金(垫付款税金)金额")
    private BigDecimal supplierGapUpTaxesAmount;


    @ApiModelProperty(value = "购货方高开金额")
    private BigDecimal customGapUpAmount;

    @ApiModelProperty(value = "购货方保证金税金金额")
    private BigDecimal customGapUpTaxesAmount;

    @ApiModelProperty(value = "购货方结算高开税金金额")
    private BigDecimal customSettleGapUpAmount;

    @ApiModelProperty(value = "折扣价")
    private BigDecimal discountPrice;


    @ApiModelProperty(value = "供货方税率配置")
    private Long supplierRateId;

    @ApiModelProperty(value = "购货方税率配置")
    private Long customRateId;

    @ApiModelProperty(value = "供方税金费率")
    private BigDecimal supplierTaxRate;

    @ApiModelProperty(value = "供方结算费率")
    private BigDecimal supplierSettleRate;

    @ApiModelProperty(value = "供货方返款公式Id")
    private Long refundFormulaId;

    @ApiModelProperty(value = "供货方返款公式")
    private String refundFormulaContent;

    @ApiModelProperty(value = "供货方高开税金公式Id")
    private Long highTaxRateFormulaId;

    @ApiModelProperty(value = "供货方高开税金公式")
    private String highTaxRateFormulaContent;

    @ApiModelProperty(value = "购货方税金费率")
    private BigDecimal customTaxRate;

    @ApiModelProperty(value = "购货方结算高开税金费率")
    private BigDecimal customSettleGapUpTaxRate;

    @ApiModelProperty(value = "购方结算费率")
    private BigDecimal customSettleRate;

    @ApiModelProperty(value = "购方结算公式Id")
    private Long settleFormulaId;

    @ApiModelProperty(value = "购方结算公式Id3")
    private Long settleFormulaId2;
    private Long settleFormulaId3;

    @ApiModelProperty(value = "购方结算公式")
    private String settleFormulaContent;


    @ApiModelProperty(value = "利润公式Id")
    private Long profitAmountFormulaId;

    @ApiModelProperty(value = "利润公式")
    private String profitAmountFormulaContent;

    @ApiModelProperty(value = "公司利润")
    private BigDecimal profitAmount;

    @ApiModelProperty(value = "市场保证金")
    private BigDecimal customBond;
    @ApiModelProperty(value = "保证金多收金额")
    private BigDecimal customOverBond;

    @ApiModelProperty(value = "状态")
    private Integer orderDetailsState;



    /**
     * 回款比例
     */
    private BigDecimal radio;

    /**
     * 垫付款应付金额
     */
    private BigDecimal supplierBond;

    /**
     * 退市场保证金
     */
    private BigDecimal returnCustomBond;
    /**
     * 支付垫付款
     */
    private BigDecimal supplierPayBond;

    /**
     * 垫付款支付日期
     */
    private String supplierBondPayDate;

    /**
     * 退垫付款日期
     */
    private String supplierRetBondDate;


    /**
     * 回款Id
     */
    private Long returnId;


    /**
     * 开票ID
     */
    private Long kaipiaoId;

    /**
     * 开票ID2
     */
    private Long kaipiaoId2;

    /**
     * 垫付款ID
     */
    private String dianfuId;


    /**
     * 垫付款状态
     */
    private String supplierBondState;
    /**
     * 回款状态
     */
    private String customReturnState;
    /**
     * 厂返状态
     */
    private String supplierRefundState;

    /**
     * 厂返状态(朗迪)
     */
    private String supplierRefundState2;

    /**
     * 结算状态
     */
    private String settleState;

    /**
     * 结算状态(按流向)
     */
    private String settleState2;
    private String settleState3;


    /**
     * 结算日期
     */
    private String settlePayDate;

    /**
     * 结算日期
     */
    private String settlePayDate2;

    private String settlePayDate3;

    /**
     * 退保证金状态
     */
    private String customBondState;

    /**
     * 退垫付款ID
     */
    private Long returnDianfuId;

    /**
     * 返款ID
     */
    private String fankuanId;


    /**
     * 返款ID(朗迪)
     */
    private String fankuanId2;

    //预付款
    private BigDecimal customYsk;

    //回款金额
    private BigDecimal returnAmount;

    //回款日期
    private String returnDate;


    //认款日期
    private String renkuanDate;

    //回款银行
    private String returnBank;

    /**
     * 结算Id
     */
    private String jiesuanId;


    /**
     * 结算Id
     */
    private String jiesuanId2;
    private String jiesuanId3;


    /**
     * 厂家退保证金
     */
    private String tbzjId;

    private BigDecimal settleRealAmount;

    private BigDecimal settleRealAmount2;

    private BigDecimal settleRealAmount3;


    /**
     * 厂家实际返款金额
     */
    private BigDecimal supplierRealAmount;

    /**
     * 厂家实际返款金额(朗迪)
     */
    private BigDecimal ldSupplierRealAmount;

    /**
     *退垫付款
     */
    private BigDecimal returnSupplierBond;


    /**
     *备注
     */
    private String remark;


    /**
     * 厂家返款日期
     */
    private String supplierRetDate;

    /**
     * 厂家返款日期（朗迪）
     */
    private String ldSupplierRetDate;



    /**
     * 厂家返款日期（对账表里使用）
     */
     private String supplierRetDate2;


    /**
     * 退市场保证金日期
     */
    private String customBondRetDate;


    private String huikuanImg;

    private String budan;




}
